home *** CD-ROM | disk | FTP | other *** search
- Path: ornews.intel.com!news
- From: thurman_b_miller@ccm2.hf.intel.com (Thurman Miller)
- Newsgroups: comp.lang.c++
- Subject: When to use "->" vs "." when calling Member functions
- Date: Wed, 17 Jan 1996 00:00:59 GMT
- Organization: Intel Corporation
- Message-ID: <4dhea1$6v8@ornews.intel.com>
- NNTP-Posting-Host: thurman-pc.ssd.intel.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- I'm confused, so please no harsh remarks :)
-
- If I've got:
-
- class Cfoo
- {
- something * getptr();
- somethingelse* m_other;
- }
-
- something * foo::getptr()
- {
- return m_other;
- }
-
-
- Now...if I'm in another class....
-
- Cfoo foo;
- somethingelse* = foo.getptr();
-
- why doesn't the following work?
-
- somethingelse* = foo->getptr();
-
- I get compile error about no "->" overloaded operator....
-
- Can someone point out the obvious when I use one notation over
- another?
-
- TIA
-
- Thurman
-
-
-
-
-
-